// @Author EthanScriptOn
// @Desc
package operator

import (
	"time"
)

type BasicMultiChannelDataOperatorConfig struct {
	OperatorConfigIdentifier interface{}
	OperatorIdentifier       interface{}
	Nesting                  interface{}
}

func GenerateBasicMultiChannelDataOperatorConfig(operatorConfigIdentifier interface{}, operatorIdentifier interface{}, nesting interface{}) *BasicMultiChannelDataOperatorConfig {
	return &BasicMultiChannelDataOperatorConfig{
		OperatorConfigIdentifier: operatorConfigIdentifier,
		OperatorIdentifier:       operatorIdentifier,
		Nesting:                  nesting,
	}
}

func (b *BasicMultiChannelDataOperatorConfig) GetOperatorConfigIdentifier(IsNesting bool) interface{} {
	if IsNesting {
		nestingConfig := GetOperatorConfig(b.Nesting)
		if nestingConfig == nil {
			return nil
		}
		return nestingConfig.GetOperatorConfigIdentifier(false)
	}
	return b.OperatorConfigIdentifier
}

func (b *BasicMultiChannelDataOperatorConfig) GetOperatorIdentifier(IsNesting bool) interface{} {
	if IsNesting {
		nestingConfig := GetOperatorConfig(b.Nesting)
		if nestingConfig == nil {
			return nil
		}
		return nestingConfig.GetOperatorIdentifier(false)
	}
	return b.OperatorIdentifier
}

func (b *BasicMultiChannelDataOperatorConfig) GenerateUniqueIdentifier() (interface{}, error) {
	return b.OperatorConfigIdentifier, nil
}

type TimeOutMultiChannelDataOperatorConfig struct {
	*BasicMultiChannelDataOperatorConfig
	TimeOut time.Duration
}

type DelayedMultiChannelDataOperatorConfig struct {
	*BasicMultiChannelDataOperatorConfig
	Delayed time.Duration
}

type LoopMultiChannelDataOperatorConfig struct {
	*BasicMultiChannelDataOperatorConfig
}
